package com.ty.user.starter.entity.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 修改密码
 *
 * @author minku
 * @date 2021-10-15
 */
@Data
public class ChangPwdDto implements Serializable {

    private static final long serialVersionUID = 8641180298293633439L;
    /**
     * userId为空时,视为修改自身的密码信息
     */
    @ApiModelProperty(value = "用户id")
    @NotNull(message = "用户id不能为空")
    private Long userId;

    @ApiModelProperty(value = "当前密码", required = true)
    @NotBlank(message = "当前密码不能为空")
    @Length(min = 8, max = 20, message = "当前密码长度介于8~20位")
    private String currentPwd;

    @ApiModelProperty(value = "新密码", required = true)
    @NotBlank(message = "新密码不能为空")
    @Length(min = 8, max = 20, message = "新密码长度介于8~20位")
    private String newPwd;
}
